﻿<UserControl x:Class="Jamcast.Plugins.GoogleMusic.UI.View.LoggedOutView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <DockPanel>
        <Grid DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="0 8 0 0" Width="290" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Content="Email:" Grid.Row="0" />
            <TextBox Name="txtLogin" Text="{Binding Login, Mode=TwoWay}" Grid.Row="1" KeyDown="txtLogin_KeyDown">
                <TextBox.Style>
                    <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsLoggingIn}" Value="true">
                                <Setter Property="IsEnabled" Value="False" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
            </TextBox>
            <Label Margin="0 8 0 0" Content="Password:" Grid.Row="2" />
            <PasswordBox Name="txtPassword" Grid.Row="3" KeyDown="txtPassword_KeyDown">
                <PasswordBox.Style>
                    <Style TargetType="PasswordBox" BasedOn="{StaticResource {x:Type PasswordBox}}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsLoggingIn}" Value="true">
                                <Setter Property="IsEnabled" Value="False" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </PasswordBox.Style>
            </PasswordBox>
            <Button Margin="0,40,0,-40" Content="Sign In" Width="90" Height="40" HorizontalAlignment="Left" Grid.Row="5" Command="{Binding LogInCommand}" CommandParameter="{Binding ElementName=txtPassword}" />
            <Label Content="{Binding LoginError}" Foreground="Red" Margin="0,140,-10,-124" Grid.Row="5" />
        </Grid>
    </DockPanel>
</UserControl>
